//统一管理咱们项目用户相关的接口
import request from '@/utils/request'

//项目用户相关的请求地址
enum API {
  IMG_APi = '/image/random.php',
  getImges_api = 'https://api.apiopen.top/api/getImages',
  SEARCH_IMG_API = '/keySearch/',
  IMGCLASSIF_API = '/360/index.php',
  HOTS_API = '/hot/wallpaperhot.html',
  ROLL_REC = '/api/daily_word/recommend',
  BAIDU_IMG = '/apihzBase/api/img/apihzimgbaidu.php',
  TR_API = '/tr/turing',
  TR_WHEA = '/tr/weather',
  TQ_API = '/tq/tianqi.php',
  WTH15_API = '/is15W/weather/',
  MMAI_API = '/lolimi/mm.php',
  JJAI_API = '/lolimi/jj.php',
  LOCALNEWS_API = '/aal/api-tplist/go.php/api/News/local_news',
  BING_IMG = '/Bing-Wallpaper-Action/main/data/zh-CN_all.json',
  HUANGJ_API = '/huangj/api.php',
  dailyNewsTypes_api = '/dailyNews/types/v2',
  dailyNewsLists_api = '/dailyNews/list/v2',
  dailyNewsDetails_api = '/dailyNews/details/v2',
  translate_api = '/google',
  hontlist_api = '/common/HotList',
  allNews_api = '/vvhan/hotlist/all',
  baiduKnow = '/apihzBase/api/zici/baikebaidu.php',
  mhImg = '/mohu/pic.php',
  music = '/music/lsdd_music.php',
}
// 二次元图片
export const dayImg = (params: any): any => request.get(API.IMG_APi, { params })
// 360壁纸
export const imgClassif360 = (params: any): any =>
  request.get(API.IMGCLASSIF_API, { params })
// 壁纸合集
export const getImages = (params: any): any =>
  request.get(API.getImges_api, { params })
// 壁纸搜索
export const searchImg360 = (params: any): any =>
  request.get(API.SEARCH_IMG_API, { params })
// 图片热搜
export const hotSearch = (): any => request.get(API.HOTS_API)
// bing 图库
export const getBingImg = (): any => request.get(API.BING_IMG)
// 百度图源
export const getBaiduImg = (params: any): any =>
  request.get(API.BAIDU_IMG, { params })
// 萌虎壁纸
export const getMoHuImgs = (params: any): any =>
  request.get(API.mhImg, { params })

// 图灵机器人
export const trBot = (params: any): any => request.get(API.TR_API, { params })
// 沫沫聊天
export const mmBot = (params: any): any => request.get(API.MMAI_API, { params })
// 傲娇
export const jjBot = (params: any): any => request.get(API.JJAI_API, { params })

// 15 天
export const weatherInfo15 = (params: any): any =>
  request.get(API.WTH15_API, { params })
// 7天
export const weatherInfo7 = (params: any): any =>
  request.get(API.TR_WHEA, { params })
// 详细信息
export const weatherDetail = (params: any): any =>
  request.get(API.TQ_API, { params })

// 新闻聚合热搜
export const allNews = (): any => request.get(API.allNews_api)
export const allNews2 = (): any => request.get(API.hontlist_api)
//  本地新闻
export const localNew = (params: any): any =>
  request.get(API.LOCALNEWS_API, { params })
const myParams = (params: any) => {
  const rollId = {
    app_id: 'yjroqmhvmjywnnqk',
    app_secret: 'Mck5hX919x1Wx6dJExAaF13u5zc8SYmR',
  }
  return {
    params: Object.assign({}, params, rollId),
  }
}
// 新闻分类 列表  详情
export const newsTypes = (params?: object): any =>
  request.get(API.dailyNewsTypes_api, myParams(params))
export const newsLists = (params?: object): any =>
  request.get(API.dailyNewsLists_api, myParams(params))
export const newsDetails = (params?: object): any =>
  request.get(API.dailyNewsDetails_api, myParams(params))

// 黄金价格
export const goldPrice = (params?: any): any =>
  request.get(API.HUANGJ_API, { params })

// 翻译
export const translateKeyword = (params: any): any =>
  request.get(API.translate_api, { params })

// 百度知道
export const baiduKnowApi = (params: any): any =>
  request.get(API.baiduKnow, { params })

// 音乐
export const getMusicList = (params: any): any =>
  request.get(API.music, { params })
